package com.cc.cmn.config;


import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@MapperScan("com.cc.cmn.mapper")
public class CmnConfig {
    /**
     * 分页插件
     */

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){

//        // 乐观锁插件
        MybatisPlusInterceptor Interceptor = new MybatisPlusInterceptor();
//        Interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
        Interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return Interceptor;

        //分页插件

    }

}
